package com.kern.academic.repository;

import com.kern.academic.entity.XRoleRights;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * Created by caoshi at 21:17 2021-08-09
 */
public interface IRoleRightsResponsitory extends JpaRepository<XRoleRights, String>,
        JpaSpecificationExecutor<XRoleRights> {

    /**
     *  根据 角色ID 查询
     * @param roleId
     * @return
     */
    List<XRoleRights> findAllByRoleId(String roleId);

    /**
     *  根据 角色id 和 权限 id 删除
     * @param roleId
     * @param rightsId
     */
    void deleteByRoleIdAndRightsId(String roleId, String rightsId);


}
